package com.feihong.txgw.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.feihong.txgw.R;
import com.feihong.txgw.json.kaika.ICCIDList;

import java.util.List;

/**
 * Created by Sabirjan on 2017/7/3.
 * TXGWApp.
 * 飞宏电子
 */

public class ICCIDListAdapter extends BaseAdapter {
    private List<ICCIDList.DataBean> data;
    private LayoutInflater inflater;

    public ICCIDListAdapter(Context context, List<ICCIDList.DataBean> items) {
        inflater = LayoutInflater.from(context);
        this.data = items;
    }

    @Override
    public int getCount() {
        if (data == null) {
            return 0;
        }

        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = inflater.inflate(R.layout.iccid_list_item, null);
        }
        TextView textView = (TextView) convertView.findViewById(R.id.txt_iccid_name);
        textView.setText(data.get(position).getIccid_no());
        return convertView;
    }
}
